package com.ly.aps.system.provider.utils;

import org.springframework.beans.BeanUtils;

import java.util.Iterator;
import java.util.List;

/**
 * @ClassName OrderMgUtils
 * @Date 2021/8/3 19:16
 * @Author pengc
 */
public class ApsSystemUtils {
    /**
     * @description 集合复制
     * @param srcList
     * @param destList
     * @param destClazz
     * @return void
     * @author pengchuan
     * @date 2021-08-03 19:16:00
     */
    public static void copyList(List srcList, List destList, Class<?> destClazz) {
        if (null != srcList && !srcList.isEmpty() && null != destList) {
            try {
                Object deskObj = null;
                Iterator var4 = srcList.iterator();

                while(var4.hasNext()) {
                    Object obj = var4.next();
                    deskObj = destClazz.newInstance();
                    BeanUtils.copyProperties(obj, deskObj);
                    destList.add(deskObj);
                }
            } catch (Exception var6) {
                var6.printStackTrace();
            }
        }
    }
}
